[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
FileSize function
DECLARATION: FileSize(var F)
PURPOSE: Returns the current size of a file.
UNIT: System
RESULT TYPE: LongInt
REMARKS: Where F is a file variable, FileSize will
return the number of components in F.
If the file variable is of type byte, then it will
return the size of that file in bytes. If the file
is empty, it will return 0.
NOTE: With {$I-}, errors are returned through IOResult
RESTRICTIONS: Cannot be used on Text files.
File must be open.
DIFFERENCES: The result type in v3.0 was an integer.
EXAMPLE: Var
F : File of Byte;
FileName : String;
Begin
Write('Enter File Name: ');
Readln(FileName);
Assign(F,FileName);
Reset(F);
Writeln('File size in bytes is: ',FileSize(F));
Close(F);
End.
See Also:
FilePos
Seek
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson